package com.dc.project.entity.map;

import com.dc.project.entity.po.TemplateDetailAttachmentField;
import com.own.component.common.base.entity.BaseMap;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * TemplateDetailAttachmentFieldMapVo
 *
 * @author chenxueli
 * @date 2025-03-19 13:23:08
 */
@Schema(title = "模板详情附件字段" + ConstantBeanSuffix.MAP_VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class TemplateDetailAttachmentFieldMapVo extends BaseMap<TemplateDetailAttachmentField> implements Serializable {

    @Schema(title = "模板详情附件id")
    private Long detailAttachmentId;

    @Schema(title = "上级字段id")
    private Long parentId;

    @Schema(title = "字段名称")
    private String name;

    @Schema(title = "字段描述")
    private String description;

    @Schema(title = "默认值")
    private String defaultValue;

    @Schema(title = "字段类型 1=文本 2=整数 3=小数 4=数字 5=表格-行循环 6=表格-列循环 7=列表 8=图片 9=区块对")
    private Integer type;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public TemplateDetailAttachmentFieldMapVo(@NonNull TemplateDetailAttachmentField entity) {
        super(entity);
        this.detailAttachmentId = entity.getFkDetailAttachmentId();
        this.parentId = entity.getFkParentId();
        this.name = entity.getName();
        this.description = entity.getDescription();
        this.defaultValue = entity.getDefaultValue();
        this.type = entity.getType();
    }

}
